package com.tubeonfire.controller.admin;

import java.io.IOException;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class AdvertisingServlet extends HttpServlet {

	private static final Logger log = Logger.getLogger(AdvertisingServlet.class
			.getName());

	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException, ServletException {
		try {
			String place = req.getParameter("place");
			if (place != null && place.equals("1")) {
				req.getRequestDispatcher("/admin/advertising_choose_01.jsp")
						.forward(req, resp);
			} else if (place != null && place.equals("2")) {
				req.getRequestDispatcher("/admin/advertising_choose_02.jsp")
						.forward(req, resp);
			} else if (place != null && place.equals("3")) {
				req.getRequestDispatcher("/admin/advertising_choose_03.jsp")
						.forward(req, resp);
			} else if (place != null && place.equals("4")) {
				req.getRequestDispatcher("/admin/advertising_choose_04.jsp")
						.forward(req, resp);
			} else if (place != null && place.equals("5")) {
				req.getRequestDispatcher("/admin/advertising_choose_05.jsp")
						.forward(req, resp);
			} else if (place != null && place.equals("6")) {
				req.getRequestDispatcher("/admin/advertising_choose_06.jsp")
						.forward(req, resp);
			} else if (place != null && place.equals("7")) {
				req.getRequestDispatcher("/admin/advertising_choose_07.jsp")
						.forward(req, resp);
			} else if (place != null && place.equals("8")) {
				req.getRequestDispatcher("/admin/advertising_choose_08.jsp")
						.forward(req, resp);
			}
		} catch (Exception e) {
			log.warning(e.toString());
			e.printStackTrace();
			resp.sendError(4004,
					"We are sorry for the inconvenience ! Please try again later !");
		}
	}
}
